<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 8/14/17
 * Time: 10:23 AM
 */

namespace common\models\workin;

/**
 * Class MortgageSignupHuirong
 * @package common\models\workin
 *
 * @property MortgageSignupHuirongBack $mortgageSignupHuirongBack
 */
class MortgageSignupHuirong extends \common\models\workin_tables\MortgageSignupHuirong
{
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'grant_key' => 'Grant Key',
            'api_key' => 'Api Key',
            'business_code' => 'Business Code',
            'plate_number' => '车牌号',
            'vehicle_number' => '车架号',
            'call_back' => 'Call Back',
            'order_report_id' => 'Order Report ID',
        ];
    }

    public function rules()
    {
        return [
            [['grant_key', 'api_key', 'plate_number', 'call_back', 'search_index'], 'required'],
            [['grant_key', 'api_key', 'business_code', 'plate_number', 'vehicle_number', 'call_back'], 'string', 'max' => 200],
            [['order_report_id'], 'string', 'max' => 40],
            [['search_index'], 'string', 'max' => 50],
            [['order_report_id'], 'unique'],
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMortgageSignupHuirongBack()
    {
        return $this->hasOne(MortgageSignupHuirongBack::className(), ['mortgage_signup_id' => 'id']);
    }
}